﻿<%@ Page Title="" Language="C#" MasterPageFile="../Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Topic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div id="replyTopic">
        <h2>
            消息主题：</h2>
        <div class="sec">
            <%= Html.SimpleUserLabel(Model.Sender) %>:<%= Model.SummrizedMessage %><span class="ignore">(<%= Model.CreateOn %>)</span>
        </div>
        <% if (Model.IsNeedSummrize)
           {%>
        <div class="sec">
            <%= Model.MessageText%>
        </div>
        <%} %>
        <div class="sec">
            消息参与者：
            <% foreach (var group in Model.Participator.GroupParticipators)
               {%>
            <%=Html.SimpleGroupLabel(group) %>
            <%}
               foreach (var user in Model.Participator.UserParticipators)
               {%>
            <%= Html.SimpleUserLabel(user) %>
            <%}
            %>(共<%= Model.Participator.AllUserMemebers.Count %>人)
        </div>
        <% if (Model.NeedConfirm)
               {%>
        <div class="sec">
            <b>该消息需要确认。</b><br />
            已确认：<%= Model.ConfirmedCount %>人 <small>未确认：<%= Model.NoConfirmCount %>人</small>
            <a href="/message/confirm?messageId=<%= Model.MessageId %>">详细</a><br />
            <%} %>
                <% if (Model.HasConfirmed.HasValue)
                   {
                       if (Model.HasConfirmed.GetValueOrDefault())
                       {%>
                <small>您已经确认了消息。</small><br />
                <%}
                       else
                       { %>
                       
                <form method="post" action="<%= Url.EzDeskUrl("/Message/ConfirmMessage")%>">
                  {%>
                  <%= Html.Hidden("messageId", Model.MessageId.ToString()) %>
                <small>您还没有确认。</small><input class="button" type="submit" value="立刻确认" /><br />
                </form>
                <%}
                   } %>
        </div>


            <div class="sec">
                <form method="post" action="<%= Url.EzDeskUrl("/Message/ReplyTopic") %>">
                <%= Html.Hidden("topicId", Model.MessageId.ToString()) %>
                <textarea cols="20" rows="3" name="replyText">回复<%= Model.Sender.Name %>:</textarea><br />
                <input type="submit" value="回复" class="button" /><%= Html.CheckBox("isReplyToAll")%><label
                    for="replyToAllGroup">回复所有参与者</label>
                </form>
            </div>
            <!-- 回复列表 -->
            <% if (Model.ReplyList != null && Model.ReplyList.Count > 0)
               {%>
            <div class="sec">
                   <%for (int index = 0; index < Model.ReplyList.Count; index++)
                   { %>
                <div>
                    <%= Html.SimpleUserLabel(Model.ReplyList[index].GetSenderInfo()) %>.&nbsp;<%= Model.ReplyList[index].MessageText %><span
                        class="ignore">(<%= Model.ReplyList[index].CreateOn.FormattedDatetime() %>)</span>
                    <a href="ReplySingle?messageId=<%= Model.ReplyList[index].MessageId.ToString() %>">回复</a>
                </div>
                <%}// end of for
                    %>
                    
            </div>
               <%}// end of if %>
        </div>
</asp:Content>
